<div class="form-inline">
    <p>
        <input name="id" id="appendedInputButton" class="span1" type="text" placeholder="Number">&nbsp;
        <?php 
        $estilo = "style='width:200px;'";
        include "mod/combo/aer_id.php";
        ?>
        <input name="data" id="appendedInputButton" class="span2" type="text" placeholder="Date" onfocus="showCalendarControl(this);">
        <input type="submit" name="btnbusca" value="Find" class="btn" >
    </p>
</div>

<table class="table table-striped table-bordered table-hover">

    <tr>
        <th width="80" height="40">Action</th>
        <th width="40">Nº</th>
        <th width="250">Nation</th>
        <th width="150">Headquarter</th>
        <th width="150">Type of Airplane / Tail Number </th>
        <th width="100">Fuel / Qtd.</th>
        <th width="250">Details</th>
        <th width="80">Date</th>
        <th width="80">Status</th>
    </tr>

    <?php
    $sql = "SELECT * FROM logisticaabastecimento 
    INNER JOIN pais ON pais.pai_id=logisticaabastecimento.pai_id
    INNER JOIN aeronave ON aeronave.aer_id=logisticaabastecimento.aer_id
    LEFT JOIN cliente ON cliente.cli_id=logisticaabastecimento.cli_id
    LEFT JOIN posto ON posto.pos_id=cliente.pos_id
    LEFT JOIN sede ON sede.sed_id=logisticaabastecimento.sed_id
    WHERE $onde ORDER BY logisticaabastecimento.log_data DESC";
    $res = sql($sql);
    $i=0;
    while($linha = mysql_fetch_array($res)) {
    ?>

    <tr>
        <td height="40">
            <p><a href="#detalhe<?=$i;?>" data-toggle="modal"><i class="icon-zoom-out"></i> View</a></p>
            <?php // include "mod/detalhe/logisticaabastecimento.php"; ?>
        </td>
        <td><big><strong><?php echo $linha['log_id'];?></strong></big></td>
        <td>
            <?php 
            echo "<p>{$linha['pai_nome']}</p>";
            echo "<p>{$linha['cli_code']} - {$linha['pos_nome']} {$linha['cli_nome']}</p>";
            ?>
        </td>
        <td><?php echo $linha['sed_nome'];?></td>
        <td><?php echo $linha['aer_nome']."&nbsp;&nbsp;/&nbsp;&nbsp;".$linha['log_num'];?></td>
        <td><?php echo "{$linha['log_comb']} - {$linha['log_qtd']}lts";?></td>
        <td>
            <?php 
            echo "<p>Request Time: ".todatabr($linha['log_dataabast'])." {$linha['log_hora']}</p>";
            echo "<p>Place: {$linha['log_local']}<p>";
            echo "<p>".nl2br($linha['log_msg'])."</p>";
            ?>
        </td>
        <td><?php echo todatabr($linha['log_data']);?></td>
        <td>
        <?php
        $sql_status = "SELECT log_sta_nome,log_sta_cor FROM logisticastatus 
        INNER JOIN logisticaacao ON logisticastatus.log_sta_id=logisticaacao.log_sta_id 
        INNER JOIN logisticaabastecimento ON logisticaabastecimento.log_id=logisticaacao.log_id 
        WHERE logisticaabastecimento.log_id='{$linha['log_id']}' ORDER BY logisticaacao.aca_id DESC";
        $res_status = sql($sql_status);
        $linha_status = mysql_fetch_array($res_status);
        echo "<span style='color:#{$linha_status['log_sta_cor']};font-weight: bold;font-size:110%;'>{$linha_status['log_sta_nome']}</span>";
        ?>
        </td>
    </tr>

    <?
    $i++;
    } 
    ?>
</table>